
/**
 * A filter for IQ packet types. Returns true only if the packet is an IQ packet
 * and it matches the type provided in the constructor.
 * 
 * @author Alexander Wenckus
 * 
 */
class IQTypeFilter : public PacketFilter {
public:
	IQTypeFilter(IQ::Type & type) : type(type) {}
	
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jivesoftware.smack.filter.PacketFilter#accept(org.jivesoftware.smack.packet.Packet)
	 */
	bool accept(Packet * packet) {
		return (typeid(*packet) == typeid(IQ)) != 0 && (IQ*)packet->getType() == type;
	}
private:
	IQ::Type type;

};
